package sg.edu.nus.iss.jass.gui.component;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.SwingConstants;

/**
 * <h5>MessageLabel to show the Message on the Form </h5>
 * This class is customized for showing message label on the form 
 *  by specifying the size and color of the label text.
 * 
 * @author Kafoor Sammil
 * 
 */
public class MessageLabel extends JLabel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4622266387793772336L;
	
	/**
	 * Constructor to create the MessageLabel Object .
	 * @param text
	 *            string to create the MessageLabel Object. 
	 */
	public MessageLabel(String text){
		super(text,SwingConstants.CENTER);
		Font f = new Font("Arial", Font.BOLD, 14);
		
		this.setFont(f);
		
	}
	
	/**
	 * Constructor to create the MessageLabel Object .
	 * @param text
	 *            string to create the MessageLabel Object. 
	 * @param success
	 * 			 If true, show the message in green color, show the message in red otherwise.            
	 */
	public MessageLabel(String text,boolean success){
		this(text);
		if(success)	setForeground(Color.green);
		else setForeground(Color.RED);
	}
	
	
}
